feat: support gateway selection for workspaces#2501
Conversation
📝 WalkthroughWalkthroughWorkspace creation and deletion now require gateway context. The renderer supports gateway selection, while manager, IPC, preload, and OpenShell CLI operations pass gateway identifiers to target the correct sandbox. ChangesGateway-scoped workspace lifecycle
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Renderer
participant Preload
participant AgentWorkspaceManager
participant OpenshellCli
Renderer->>Preload: create or remove workspace with gateway
Preload->>AgentWorkspaceManager: forward gateway through IPC
AgentWorkspaceManager->>OpenshellCli: createSandbox or deleteSandbox with gateway
OpenshellCli-->>AgentWorkspaceManager: sandbox operation result
AgentWorkspaceManager-->>Preload: workspace operation result
Preload-->>Renderer: operation result
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
68da011 to
43d5366
Compare
|
@CodeRabbit resolve |
✅ Action performedComments resolved and changes approved. |
b0c6465 to
1a44dd6
Compare
|
@CodeRabbit resolve |
✅ Action performedComments resolved and changes approved. |
1a44dd6 to
7a60a3d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.ts`:
- Around line 38-42: Update the existing beforeEach hook in
SandboxActions.spec.ts to call vi.useFakeTimers({ shouldAdvanceTime: true })
alongside the current mock setup, ensuring Svelte render scheduling uses
advancing fake timers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d91aa3a4-4a5b-4468-aa87-c159c6296a8b
📒 Files selected for processing (17)
packages/api/src/agent-workspace-info.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/preload/src/index.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/stores/agent-workspace-create-draft.svelte.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
- GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
- GitHub Check: unit tests / macos-15
- GitHub Check: Linux
- GitHub Check: unit tests / ubuntu-24.04
- GitHub Check: typecheck
- GitHub Check: unit tests / windows-2022
- GitHub Check: linter, formatters
- GitHub Check: macOS
- GitHub Check: Windows
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use
/@/path aliases instead of relative paths for imports outside the current directory's module group; use relative imports only for sibling modules within the same directory
Files:
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/api/src/agent-workspace-info.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/preload/src/index.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
**/*.spec.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.spec.{ts,tsx,js,jsx}: Usetest()instead ofit()for test cases in Vitest unit tests
Usevi.mock(import('...'))for auto-mocking modules in unit tests; avoid manual mock factories when possible
Usevi.resetAllMocks()inbeforeEachhooks instead ofvi.clearAllMocks()for resetting mocks between tests
When an auto-mocked function or class method needs a real implementation, usevi.mocked(...)with the prototype pattern for class methods:vi.mocked(MyClass.prototype.myMethod).mockImplementation(...)
Files:
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
packages/main/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/main/src/**/*.{ts,tsx}: UseipcHandle()to expose handlers in the main process with naming convention<registry-name>:<action>(e.g.,container-provider-registry:listContainers)
UseapiSender.send()to send events from main process to renderer for real-time updates
Long-running operations should useTaskManager.createTask()with title and action configuration
Files:
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
packages/{main,renderer,preload}/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Container operations must include
engineIdparameter to identify the container engine
Files:
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/preload/src/index.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
🧠 Learnings (13)
📚 Learning: 2026-03-17T11:49:39.964Z
Learnt from: MarsKubeX
Repo: kortex-hub/kortex PR: 1111
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.svelte:46-52
Timestamp: 2026-03-17T11:49:39.964Z
Learning: In Svelte components like AgentWorkspaceCard.svelte and CustomPick.svelte, using a div with role="button" and tabindex="0" as the clickable card container with an inner native <button> (e.g., for a remove action) is acceptable because nested <button> elements are invalid per HTML spec. Ensure the inner button's events do not bubble by calling stopPropagation on both click and keydown handlers. Do not flag this pattern as an accessibility issue when implemented this way, but verify that keyboard activation (Enter/Space) and ARIA semantics are preserved and that focus management remains clear.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte
📚 Learning: 2026-04-15T08:04:32.031Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1336
File: packages/renderer/src/lib/guided-setup/GuidedSetup.svelte:9-11
Timestamp: 2026-04-15T08:04:32.031Z
Learning: For Svelte components in this repo, if a callback prop is typed as `() => void`, TypeScript idiomatically allows passing async functions (e.g., `() => Promise<void>`), because `() => void` indicates the caller ignores the return value rather than requiring `undefined`. Do not recommend changing these prop types to `() => void | Promise<void>` solely to “fix” async compatibility—unless there is an actual need for the caller to observe the returned value.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte
📚 Learning: 2026-04-28T13:34:51.610Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1431
File: packages/renderer/src/lib/guided-setup/panels/OpenCodePanel.svelte:14-20
Timestamp: 2026-04-28T13:34:51.610Z
Learning: In this repo’s Svelte renderer (packages/renderer/src/**/*.svelte), `podman-desktop/ui-svelte`’s `Link` component does not accept an `href` prop. For opening external URLs, use the established pattern `on:click={() => window.openExternal(url)}` (optionally typed as `on:click={(): Promise<void> => window.openExternal(url)}`), consistent with existing components like `ProviderLinks.svelte`, `WelcomePage.svelte`, and `OpenCodePanel.svelte`. Do not treat `window.openExternal()` usage in renderer Svelte components as bypassing a security restriction, and do not recommend replacing it with `Link`/`href`-based navigation. (There is also no `setupSecurityRestrictionsOnLinks` utility in the renderer.)
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte
📚 Learning: 2026-04-29T11:54:22.423Z
Learnt from: vancura
Repo: openkaiden/kaiden PR: 1494
File: packages/renderer/src/Loader.svelte:13-13
Timestamp: 2026-04-29T11:54:22.423Z
Learning: In this codebase’s renderer, timer variables in Svelte files (e.g., in `packages/renderer/src/Loader.svelte`) that store `setTimeout` handles are intentionally typed as `NodeJS.Timeout` (and not `ReturnType<typeof setTimeout>`). When reviewing, do not flag or recommend changing this to `ReturnType<typeof setTimeout>` for portability—treat `NodeJS.Timeout` as the established convention for renderer timer variables.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte
📚 Learning: 2026-07-14T11:55:38.534Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2454
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceTerminal.svelte:143-160
Timestamp: 2026-07-14T11:55:38.534Z
Learning: In this Electron app, the main process prevents renderer `beforeunload` from firing on window close/app quit/navigation by calling `e.preventDefault()` on `browserWindow` `close` and then either `hide()` (no unload) or `destroy()` (bypasses `beforeunload`), and `app.on('before-quit')` also calls `browserWindow.destroy()`. As a result, renderer `beforeunload` (and any “reload confirmation” handler) should only run for an explicit page reload (e.g., `location.reload()`) and not for close/quit actions. During review, do NOT flag hardcoded `location.reload()` calls inside `beforeunload`/reload-confirmation handlers as “hijacking” close/quit behavior.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte
📚 Learning: 2026-05-12T17:14:02.153Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1850
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte:66-70
Timestamp: 2026-05-12T17:14:02.153Z
Learning: When reviewing code that uses `AgentWorkspaceSummaryUI.runtime`, treat it as a required, non-null `string` per the `openkaiden/kdn-api` 0.12.0 schema. Therefore, code like `a.runtime.localeCompare(b.runtime)` is safe and should not trigger warnings about possible `undefined`/`null` values or suggestions to use nullish coalescing/optional chaining for `runtime` (unless the current local types still mark `runtime` as optional, indicating a schema/version mismatch).
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/api/src/agent-workspace-info.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/preload/src/index.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
📚 Learning: 2026-06-10T15:22:39.639Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 2115
File: packages/renderer/src/lib/models/SemanticRouterCreate.svelte:134-137
Timestamp: 2026-06-10T15:22:39.639Z
Learning: In multi-step wizard UIs, it’s acceptable for “Next step” buttons to be temporarily non-interactive during incremental work delivered across multiple PRs. When reviewing Svelte files under `packages/renderer/src/lib/**`, do not flag these UX issues if the button lacks an onClick handler *and* there is an explicit TODO comment indicating deferred wiring, and the PR author confirms (in the PR description) that this is an intentional staged implementation. If no TODO/deferred-wiring marker (or no author confirmation) is present, treat missing handlers as a potential UX issue.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte
📚 Learning: 2026-03-09T08:47:09.657Z
Learnt from: benoitf
Repo: kortex-hub/kortex PR: 1077
File: packages/main/src/plugin/skill/skill-manager.ts:80-109
Timestamp: 2026-03-09T08:47:09.657Z
Learning: In the kortex-hub/kortex repository, IPC handlers (via ipcHandle()) may be registered directly inside feature manager/service classes (e.g., SkillManager in packages/main/src/plugin/skill/skill-manager.ts) rather than exclusively in packages/main/src/plugin/index.ts. Treat this as an accepted design pattern for files under the plugin directory. Reviewers should not require centralization in index.ts; allow IPC registration proximity to the feature that owns the handler. When reviewing code, accept direct ipcHandle() registrations inside feature managers and ensure the pattern is consistently applied across similar feature-manager modules.
Applied to files:
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
📚 Learning: 2026-06-29T13:16:53.102Z
Learnt from: benoitf
Repo: openkaiden/kaiden PR: 2296
File: extensions/container/packages/extension/src/helper/socket-finder/_socket-finder-module.ts:28-29
Timestamp: 2026-06-29T13:16:53.102Z
Learning: When reviewing imports in openkaiden/kaiden TypeScript/JavaScript files, prefer the configured `/@/` path alias instead of relative imports that would require traversing out of the current directory/module group (i.e., paths containing `..` that cross boundaries).
Do not require alias conversion for descendant-path relative imports within the socket-finder module directory—for example, in `extensions/container/packages/extension/src/helper/socket-finder/**`, imports like `./podman/podman-version-detector` and `./podman/podman-windows-finder` are acceptable and should not be flagged.
Applied to files:
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/api/src/agent-workspace-info.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/preload/src/index.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
📚 Learning: 2026-04-15T08:51:08.199Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1336
File: packages/renderer/src/lib/guided-setup/GuidedSetup.spec.ts:64-69
Timestamp: 2026-04-15T08:51:08.199Z
Learning: For Svelte component test files under `packages/renderer/src/**` with names ending in `.spec.ts` that use `render` from `testing-library/svelte`, call `vi.useFakeTimers({ shouldAdvanceTime: true })` inside a `beforeEach`. Keep it in `beforeEach` for these tests to avoid flakiness from Svelte’s internal tick scheduling; do not remove or flag it based on the presence/absence of explicit timer manipulation in individual tests.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.ts
📚 Learning: 2026-06-16T06:15:26.225Z
Learnt from: gastoner
Repo: openkaiden/kaiden PR: 2145
File: packages/renderer/src/lib/mcp/MCPServerRemoteListActions.spec.ts:46-49
Timestamp: 2026-06-16T06:15:26.225Z
Learning: For renderer unit tests in this repo (files included in `packages/renderer/vite.config.js` via `setupFiles`), do not manually mock `window` API methods in `beforeEach` or within the spec. The test setup (`packages/renderer/vite.tests.setup.js`) reads `packages/preload/exposedInMainWorld.d.ts` and defines each declared `Window` method on `window` as a `vi.fn()` using `Object.defineProperty`, so `window.*` methods (e.g., `startMcpServer`, `stopMcpServer`, `showMessageBox`) are already present as mocks. Only add an explicit mock if the method is not declared in `exposedInMainWorld.d.ts` (in which case update the `.d.ts` so the shared setup can generate the mock).
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.ts
📚 Learning: 2026-04-17T20:27:03.231Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 1379
File: packages/renderer/src/stores/model-catalog.ts:5-21
Timestamp: 2026-04-17T20:27:03.231Z
Learning: In openkaiden/kaiden’s Electron renderer (single window, no shared localStorage origin across tabs/windows), do not suggest using `window.addEventListener('storage', ...)` for localStorage cross-tab synchronization. For store code like `packages/renderer/src/stores/model-catalog.ts`, treat `storage` events as not applicable for syncing state; use other intra-window state/update mechanisms instead.
Applied to files:
packages/renderer/src/stores/agent-workspace-create-draft.svelte.ts
📚 Learning: 2026-03-17T12:06:33.221Z
Learnt from: MarsKubeX
Repo: kortex-hub/kortex PR: 1111
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte:3-37
Timestamp: 2026-03-17T12:06:33.221Z
Learning: In AgentWorkspaceDetails.svelte (kortex-hub/kortex), render logic for a dynamic route segment like /agent-workspaces/:id/* should fetch data onMount using a prop derived from the route param (e.g., workspaceId), since tinro destroys/recreates the component on route changes and the prop does not update on a live instance. Do not replace onMount with $effect for this pattern. Reviewers should verify that data fetching occurs in onMount and that there is no route-param-based reactivity via $effect; if the component were to persist across route changes, a $watch/$effect pattern would be appropriate, but this file intentionally relies on onMount per route lifecycle.
Applied to files:
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte
🔇 Additional comments (16)
packages/api/src/agent-workspace-info.ts (1)
61-69: LGTM!Also applies to: 74-78
packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.ts (1)
40-40: LGTM!packages/preload/src/index.ts (1)
343-348: LGTM!Also applies to: 387-389
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte (1)
74-77: LGTM!packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte (1)
448-451: LGTM!packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.svelte (1)
16-16: LGTM!packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.ts (1)
160-160: LGTM!Also applies to: 230-230
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.ts (1)
1021-1021: LGTM!packages/renderer/src/stores/agent-workspace-create-draft.svelte.ts (1)
33-33: LGTM!Also applies to: 59-59
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte (1)
19-19: LGTM!Also applies to: 212-220, 277-290, 441-465, 479-523, 578-591
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.svelte (1)
3-15: LGTM!Also applies to: 34-35, 62-73, 82-97, 170-171
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.ts (1)
31-31: LGTM!Also applies to: 59-59, 178-180, 247-290, 313-337
packages/main/src/plugin/openshell-cli/openshell-cli.ts (1)
240-245: LGTM!packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts (1)
510-522: LGTM!packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts (1)
51-51: LGTM!Also applies to: 204-207, 228-228, 248-248, 410-416, 420-421, 502-502, 506-507, 609-614, 647-648
packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts (1)
275-275: LGTM!Also applies to: 295-302, 336-343, 344-366, 633-633, 850-850, 964-969, 970-974, 985-985, 994-994, 1005-1005, 1014-1029
jeffmaury
left a comment
There was a problem hiding this comment.
The list of secrets available to set into the workspace needs to be filtered by gateway as well
I will address this too but I think this adds to the scope of this pr. I have a potential solution but increases the size by a lot since it has to touch the secrets manager code parts too |
Signed-off-by: Brian Mahabir <56164556+bmahabirbu@users.noreply.github.com>
7a60a3d to
97cfb66
Compare
|
@CodeRabbit resolve |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts`:
- Line 228: Reject empty or missing gateway values before any workspace or
sandbox lifecycle operation. In
packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts:228-228,
validate the gateway before sandbox creation; at 410-421 and 502-507, validate
before workspace resolution/deletion and sandbox deletion; at 609-614 and
647-648, validate the IPC remove and sandbox-delete arguments respectively,
preserving the existing behavior for valid gateway strings.
- Around line 246-248: Update the policy-application flow around updatePolicy in
the agent workspace manager to select options.gateway before invoking
updatePolicy. Ensure the gateway selection occurs after sandbox creation and
before policy updates, so the command targets the gateway where the workspace
was created, while preserving the existing cleanup behavior on failure.
In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte`:
- Line 522: Update the gateway-change handling and submission flow in
AgentWorkspaceCreate so selected secret IDs are filtered or reset whenever
selectedGateway changes, ensuring the creation request includes only secrets
available to that gateway. Preserve the existing gateway-scoped request and
avoid submitting stale globally selected secrets.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0fe5b47d-c6f0-425e-b912-863dd3abb1d3
📒 Files selected for processing (17)
packages/api/src/agent-workspace-info.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/preload/src/index.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/stores/agent-workspace-create-draft.svelte.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
- GitHub Check: unit tests / ubuntu-24.04
- GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
- GitHub Check: unit tests / macos-15
- GitHub Check: linter, formatters
- GitHub Check: typecheck
- GitHub Check: unit tests / windows-2022
- GitHub Check: Linux
- GitHub Check: macOS
- GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
- GitHub Check: Windows
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use
/@/path aliases instead of relative paths for imports outside the current directory's module group; use relative imports only for sibling modules within the same directory
Files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/api/src/agent-workspace-info.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/preload/src/index.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
**/*.spec.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.spec.{ts,tsx,js,jsx}: Usetest()instead ofit()for test cases in Vitest unit tests
Usevi.mock(import('...'))for auto-mocking modules in unit tests; avoid manual mock factories when possible
Usevi.resetAllMocks()inbeforeEachhooks instead ofvi.clearAllMocks()for resetting mocks between tests
When an auto-mocked function or class method needs a real implementation, usevi.mocked(...)with the prototype pattern for class methods:vi.mocked(MyClass.prototype.myMethod).mockImplementation(...)
Files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
packages/{main,renderer,preload}/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Container operations must include
engineIdparameter to identify the container engine
Files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/preload/src/index.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
packages/main/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/main/src/**/*.{ts,tsx}: UseipcHandle()to expose handlers in the main process with naming convention<registry-name>:<action>(e.g.,container-provider-registry:listContainers)
UseapiSender.send()to send events from main process to renderer for real-time updates
Long-running operations should useTaskManager.createTask()with title and action configuration
Files:
packages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
🧠 Learnings (13)
📚 Learning: 2026-03-17T11:49:39.964Z
Learnt from: MarsKubeX
Repo: kortex-hub/kortex PR: 1111
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.svelte:46-52
Timestamp: 2026-03-17T11:49:39.964Z
Learning: In Svelte components like AgentWorkspaceCard.svelte and CustomPick.svelte, using a div with role="button" and tabindex="0" as the clickable card container with an inner native <button> (e.g., for a remove action) is acceptable because nested <button> elements are invalid per HTML spec. Ensure the inner button's events do not bubble by calling stopPropagation on both click and keydown handlers. Do not flag this pattern as an accessibility issue when implemented this way, but verify that keyboard activation (Enter/Space) and ARIA semantics are preserved and that focus management remains clear.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte
📚 Learning: 2026-04-15T08:04:32.031Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1336
File: packages/renderer/src/lib/guided-setup/GuidedSetup.svelte:9-11
Timestamp: 2026-04-15T08:04:32.031Z
Learning: For Svelte components in this repo, if a callback prop is typed as `() => void`, TypeScript idiomatically allows passing async functions (e.g., `() => Promise<void>`), because `() => void` indicates the caller ignores the return value rather than requiring `undefined`. Do not recommend changing these prop types to `() => void | Promise<void>` solely to “fix” async compatibility—unless there is an actual need for the caller to observe the returned value.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte
📚 Learning: 2026-04-28T13:34:51.610Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1431
File: packages/renderer/src/lib/guided-setup/panels/OpenCodePanel.svelte:14-20
Timestamp: 2026-04-28T13:34:51.610Z
Learning: In this repo’s Svelte renderer (packages/renderer/src/**/*.svelte), `podman-desktop/ui-svelte`’s `Link` component does not accept an `href` prop. For opening external URLs, use the established pattern `on:click={() => window.openExternal(url)}` (optionally typed as `on:click={(): Promise<void> => window.openExternal(url)}`), consistent with existing components like `ProviderLinks.svelte`, `WelcomePage.svelte`, and `OpenCodePanel.svelte`. Do not treat `window.openExternal()` usage in renderer Svelte components as bypassing a security restriction, and do not recommend replacing it with `Link`/`href`-based navigation. (There is also no `setupSecurityRestrictionsOnLinks` utility in the renderer.)
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte
📚 Learning: 2026-04-29T11:54:22.423Z
Learnt from: vancura
Repo: openkaiden/kaiden PR: 1494
File: packages/renderer/src/Loader.svelte:13-13
Timestamp: 2026-04-29T11:54:22.423Z
Learning: In this codebase’s renderer, timer variables in Svelte files (e.g., in `packages/renderer/src/Loader.svelte`) that store `setTimeout` handles are intentionally typed as `NodeJS.Timeout` (and not `ReturnType<typeof setTimeout>`). When reviewing, do not flag or recommend changing this to `ReturnType<typeof setTimeout>` for portability—treat `NodeJS.Timeout` as the established convention for renderer timer variables.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte
📚 Learning: 2026-07-14T11:55:38.534Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2454
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceTerminal.svelte:143-160
Timestamp: 2026-07-14T11:55:38.534Z
Learning: In this Electron app, the main process prevents renderer `beforeunload` from firing on window close/app quit/navigation by calling `e.preventDefault()` on `browserWindow` `close` and then either `hide()` (no unload) or `destroy()` (bypasses `beforeunload`), and `app.on('before-quit')` also calls `browserWindow.destroy()`. As a result, renderer `beforeunload` (and any “reload confirmation” handler) should only run for an explicit page reload (e.g., `location.reload()`) and not for close/quit actions. During review, do NOT flag hardcoded `location.reload()` calls inside `beforeunload`/reload-confirmation handlers as “hijacking” close/quit behavior.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte
📚 Learning: 2026-05-12T17:14:02.153Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1850
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte:66-70
Timestamp: 2026-05-12T17:14:02.153Z
Learning: When reviewing code that uses `AgentWorkspaceSummaryUI.runtime`, treat it as a required, non-null `string` per the `openkaiden/kdn-api` 0.12.0 schema. Therefore, code like `a.runtime.localeCompare(b.runtime)` is safe and should not trigger warnings about possible `undefined`/`null` values or suggestions to use nullish coalescing/optional chaining for `runtime` (unless the current local types still mark `runtime` as optional, indicating a schema/version mismatch).
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/api/src/agent-workspace-info.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/preload/src/index.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.sveltepackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
📚 Learning: 2026-06-10T15:22:39.639Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 2115
File: packages/renderer/src/lib/models/SemanticRouterCreate.svelte:134-137
Timestamp: 2026-06-10T15:22:39.639Z
Learning: In multi-step wizard UIs, it’s acceptable for “Next step” buttons to be temporarily non-interactive during incremental work delivered across multiple PRs. When reviewing Svelte files under `packages/renderer/src/lib/**`, do not flag these UX issues if the button lacks an onClick handler *and* there is an explicit TODO comment indicating deferred wiring, and the PR author confirms (in the PR description) that this is an intentional staged implementation. If no TODO/deferred-wiring marker (or no author confirmation) is present, treat missing handlers as a potential UX issue.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.sveltepackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.svelte
📚 Learning: 2026-03-17T12:06:33.221Z
Learnt from: MarsKubeX
Repo: kortex-hub/kortex PR: 1111
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte:3-37
Timestamp: 2026-03-17T12:06:33.221Z
Learning: In AgentWorkspaceDetails.svelte (kortex-hub/kortex), render logic for a dynamic route segment like /agent-workspaces/:id/* should fetch data onMount using a prop derived from the route param (e.g., workspaceId), since tinro destroys/recreates the component on route changes and the prop does not update on a live instance. Do not replace onMount with $effect for this pattern. Reviewers should verify that data fetching occurs in onMount and that there is no route-param-based reactivity via $effect; if the component were to persist across route changes, a $watch/$effect pattern would be appropriate, but this file intentionally relies on onMount per route lifecycle.
Applied to files:
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte
📚 Learning: 2026-04-15T08:51:08.199Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1336
File: packages/renderer/src/lib/guided-setup/GuidedSetup.spec.ts:64-69
Timestamp: 2026-04-15T08:51:08.199Z
Learning: For Svelte component test files under `packages/renderer/src/**` with names ending in `.spec.ts` that use `render` from `testing-library/svelte`, call `vi.useFakeTimers({ shouldAdvanceTime: true })` inside a `beforeEach`. Keep it in `beforeEach` for these tests to avoid flakiness from Svelte’s internal tick scheduling; do not remove or flag it based on the presence/absence of explicit timer manipulation in individual tests.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.ts
📚 Learning: 2026-06-16T06:15:26.225Z
Learnt from: gastoner
Repo: openkaiden/kaiden PR: 2145
File: packages/renderer/src/lib/mcp/MCPServerRemoteListActions.spec.ts:46-49
Timestamp: 2026-06-16T06:15:26.225Z
Learning: For renderer unit tests in this repo (files included in `packages/renderer/vite.config.js` via `setupFiles`), do not manually mock `window` API methods in `beforeEach` or within the spec. The test setup (`packages/renderer/vite.tests.setup.js`) reads `packages/preload/exposedInMainWorld.d.ts` and defines each declared `Window` method on `window` as a `vi.fn()` using `Object.defineProperty`, so `window.*` methods (e.g., `startMcpServer`, `stopMcpServer`, `showMessageBox`) are already present as mocks. Only add an explicit mock if the method is not declared in `exposedInMainWorld.d.ts` (in which case update the `.d.ts` so the shared setup can generate the mock).
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.ts
📚 Learning: 2026-06-29T13:16:53.102Z
Learnt from: benoitf
Repo: openkaiden/kaiden PR: 2296
File: extensions/container/packages/extension/src/helper/socket-finder/_socket-finder-module.ts:28-29
Timestamp: 2026-06-29T13:16:53.102Z
Learning: When reviewing imports in openkaiden/kaiden TypeScript/JavaScript files, prefer the configured `/@/` path alias instead of relative imports that would require traversing out of the current directory/module group (i.e., paths containing `..` that cross boundaries).
Do not require alias conversion for descendant-path relative imports within the socket-finder module directory—for example, in `extensions/container/packages/extension/src/helper/socket-finder/**`, imports like `./podman/podman-version-detector` and `./podman/podman-windows-finder` are acceptable and should not be flagged.
Applied to files:
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.tspackages/api/src/agent-workspace-info.tspackages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/preload/src/index.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.tspackages/renderer/src/stores/agent-workspace-create-draft.svelte.tspackages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
📚 Learning: 2026-03-09T08:47:09.657Z
Learnt from: benoitf
Repo: kortex-hub/kortex PR: 1077
File: packages/main/src/plugin/skill/skill-manager.ts:80-109
Timestamp: 2026-03-09T08:47:09.657Z
Learning: In the kortex-hub/kortex repository, IPC handlers (via ipcHandle()) may be registered directly inside feature manager/service classes (e.g., SkillManager in packages/main/src/plugin/skill/skill-manager.ts) rather than exclusively in packages/main/src/plugin/index.ts. Treat this as an accepted design pattern for files under the plugin directory. Reviewers should not require centralization in index.ts; allow IPC registration proximity to the feature that owns the handler. When reviewing code, accept direct ipcHandle() registrations inside feature managers and ensure the pattern is consistently applied across similar feature-manager modules.
Applied to files:
packages/main/src/plugin/openshell-cli/openshell-cli.spec.tspackages/main/src/plugin/agent-workspace/workspace-config-writer.spec.tspackages/main/src/plugin/openshell-cli/openshell-cli.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.tspackages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
📚 Learning: 2026-04-17T20:27:03.231Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 1379
File: packages/renderer/src/stores/model-catalog.ts:5-21
Timestamp: 2026-04-17T20:27:03.231Z
Learning: In openkaiden/kaiden’s Electron renderer (single window, no shared localStorage origin across tabs/windows), do not suggest using `window.addEventListener('storage', ...)` for localStorage cross-tab synchronization. For store code like `packages/renderer/src/stores/model-catalog.ts`, treat `storage` events as not applicable for syncing state; use other intra-window state/update mechanisms instead.
Applied to files:
packages/renderer/src/stores/agent-workspace-create-draft.svelte.ts
🔇 Additional comments (15)
packages/api/src/agent-workspace-info.ts (1)
78-78: LGTM!packages/main/src/plugin/agent-workspace/workspace-config-writer.spec.ts (1)
40-40: LGTM!packages/preload/src/index.ts (1)
343-348: LGTM!Also applies to: 387-389
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.svelte (1)
16-16: LGTM!packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.ts (1)
160-160: LGTM!Also applies to: 230-230
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetailsSettings.spec.ts (1)
1021-1021: LGTM!packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte (1)
77-77: 🗄️ Data Integrity & IntegrationNo issue: the deletion path uses the gateway passed from the selected workspace.
remove(id, gateway)filters workspaces byentry.gateway.name === gatewaybefore findingws.id === id, so duplicate names across gateways do not route to the wrong gateway.> Likely an incorrect or invalid review comment.packages/renderer/src/stores/agent-workspace-create-draft.svelte.ts (1)
30-33: LGTM!Also applies to: 55-59
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.svelte (1)
19-19: LGTM!Also applies to: 212-220, 277-290, 444-460, 581-591
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreateStepWorkspace.svelte (1)
3-15: LGTM!Also applies to: 34-35, 82-97
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCreate.spec.ts (1)
31-31: LGTM!Also applies to: 59-59, 178-180, 247-290
packages/main/src/plugin/openshell-cli/openshell-cli.ts (1)
240-245: LGTM!packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts (1)
510-522: LGTM!packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts (1)
130-142: LGTM!Also applies to: 187-187, 260-267, 290-290, 310-317, 351-351, 375-375, 648-648, 865-865, 979-1044
packages/renderer/src/lib/agent-workspaces/columns/SandboxActions.spec.ts (1)
29-50: LGTM!
✅ Action performedComments resolved and changes approved. |
Summary
Fixes #2487
Tests
Ok to test this on podman is pretty involved because if we have multiple gateways connected to the same podman socket (i.e rootless socket) openshell sandbox list will show dups of each sandbox.
The reason is since the gateways have access to both. Its a openshell bug because the sandbox list should filter by namespace which it currently does not as of 0.0086
Docker driver works fine however because it correctly filters the namespice even if both gateways have access to containers
Now if you want to continue with podman the workaround is to create a gateway that connects to the rootful socket. On mac since only one podman machine can be run at the same time it wont work. Maybe its possible to have docker container runtime running at the same time to create a gateway targetted to that socket but i havent tested this?
On linux just start the rootful socket
sudo systemctl start podman.socketCreate a minimal development-auth configuration:
Start the gateway in a new terminal
Now create the sandbox again:
openshell --gateway openshell sandbox create --name rootless-demo-box --no-tty -- sh -lc 'echo "Created by the rootless gateway"'So now that created a simple sandbox using both gateways
Start kaiden with this pr you should see both sandboxes with both gateways able to delete them and in the workspace creation now see a gateway category
Screencast.From.2026-07-20.19-55-46.mp4
gateway selector will only show if multi gateways is detected